import app from '@/app'
import { permission } from '@/api/manage'

import base from '@/app/model'

// 继承总模型
const model = new base;

model.get = ids => {
  return new Promise((resolve, jeject) => {
    app.ui.loading()
    permission(ids).then(res => {
      model.setList(res)
      resolve(res)
    }).catch(res => {
      jeject(res)
    }).finally(() => {
      app.ui.loadingClose()
    })
  })
}

export default model